package LeetCode;

public class LC45 {
    public int jump(int[] nums) {
        int steps = 0;
        int start = 0;
        int end = 0;
        while (end < nums.length-1) {
            int max = end;
            for (int i = start; i <= end; i++) {
                if (nums[i]+i > max) {
                    max = nums[i]+i;
                }
            }
            start = end+1;
            end = max;
            steps++;
        }
        return steps;
    }
}
